import java.text.SimpleDateFormat;
import java.util.Date;


public class SingleOccurrenceEvent implements Comparable {
	
	private Date start;
	private Date end;
	private String title;
	private String description;
	public Date getStart() {
		return start;
	}
	public void setStart(Date start) {
		this.start = start;
	}
	public Date getEnd() {
		return end;
	}
	public void setEnd(Date end) {
		this.end = end;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String content) {
		this.description = content;
	}
	
	private static SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
	private static SimpleDateFormat timeFormat = new SimpleDateFormat("HH:mm");
	
	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append(dateFormat.format(start));
		sb.append(" ");
		sb.append(timeFormat.format(start));
		sb.append(" - ");
		sb.append(dateFormat.format(end));
		sb.append(" ");
		sb.append(timeFormat.format(end));
		sb.append(" ");
		sb.append(title);
		sb.append(" (");
		sb.append(description);
		sb.append(")");
		return sb.toString();
	}
	
	public int compareTo(Object o) {
		SingleOccurrenceEvent other = (SingleOccurrenceEvent) o;
		return this.getStart().compareTo(other.getStart());
	}

}
